package cn.cdg.mall.controller;

import cn.cdg.mall.pojo.po.UserPO;
import cn.cdg.mall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/login")
    public boolean userLogin(@RequestBody UserPO userPO) {
        return userService.userLogin(userPO);
    }

    @RequestMapping("/register")
    public boolean userRegister(@RequestBody UserPO userPO) {
        return userService.userRegister(userPO);
    }
}
